/*  1:   */ package org.intellij.images.thumbnail.impl;
/*  2:   */ 
/*  3:   */

import com.intellij.ide.SelectInContext;
import com.intellij.ide.SelectInTarget;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import org.intellij.images.fileTypes.ImageFileTypeManager;
import org.intellij.images.thumbnail.ThumbnailManager;
import org.intellij.images.thumbnail.ThumbnailView;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */ 
/* 11:   */ final class ThumbnailSelectInTarget
/* 12:   */   implements SelectInTarget
/* 13:   */ {
/* 14:   */   public boolean canSelect(SelectInContext paramSelectInContext)
/* 15:   */   {
/* 16:31 */     VirtualFile localVirtualFile = paramSelectInContext.getVirtualFile();
/* 17:32 */     return (ImageFileTypeManager.getInstance().isImage(localVirtualFile)) && (localVirtualFile.getParent() != null);
/* 18:   */   }
/* 19:   */   
/* 20:   */   public void selectIn(SelectInContext paramSelectInContext, boolean paramBoolean)
/* 21:   */   {
/* 22:36 */     VirtualFile localVirtualFile1 = paramSelectInContext.getVirtualFile();
/* 23:37 */     VirtualFile localVirtualFile2 = localVirtualFile1.getParent();
/* 24:38 */     if (localVirtualFile2 != null)
/* 25:   */     {
/* 26:39 */       Project localProject = paramSelectInContext.getProject();
/* 27:40 */       ThumbnailView localThumbnailView = ThumbnailManager.getManager(localProject).getThumbnailView();
/* 28:41 */       localThumbnailView.setRoot(localVirtualFile2);
/* 29:42 */       localThumbnailView.setVisible(true);
/* 30:43 */       localThumbnailView.setSelected(localVirtualFile1, true);
/* 31:44 */       localThumbnailView.scrollToSelection();
/* 32:   */     }
/* 33:   */   }
/* 34:   */   
/* 35:   */   public String toString()
/* 36:   */   {
/* 37:49 */     return getToolWindowId();
/* 38:   */   }
/* 39:   */   
/* 40:   */   public String getToolWindowId()
/* 41:   */   {
/* 42:53 */     return ThumbnailView.TOOLWINDOW_ID;
/* 43:   */   }
/* 44:   */   
/* 45:   */   public String getMinorViewId()
/* 46:   */   {
/* 47:57 */     return null;
/* 48:   */   }
/* 49:   */   
/* 50:   */   public float getWeight()
/* 51:   */   {
/* 52:61 */     return 10.0F;
/* 53:   */   }
/* 54:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.intellij.images.thumbnail.impl.ThumbnailSelectInTarget

 * JD-Core Version:    0.7.0.1

 */